<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'todo-form',
    'enableAjaxValidation' => false,
));
?>

<?php echo $form->errorSummary($model, null, null, array('class' => 'message error')); ?>

<p>
    <?php echo $form->labelEx($model, 'title'); ?>
    <?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 255, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'description'); ?>
    <?php echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'start_date'); ?> <br/>
<?php
    $this->widget('application.extensions.timepicker.EJuiDateTimePicker', array(
    'model' => $model,
    'attribute' => 'start_date',
    'options' => array(
        'dateFormat' => 'yy-mm-dd',
        'minDate' => '2011-1-1',
        'showAnim' => 'fold',
    ),
    'htmlOptions' => array(
    ),
));
    ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'priority'); ?> <em>(1-5. 1 as the lowest priority)</em><br/>
<?php
    $this->widget('zii.widgets.jui.CJuiSliderInput', array(
    'model' => $model,
    'attribute' => 'priority',
    'value' => 3,
    'options' => array(
        'min' => 1,
        'max' => 5,
    ),
    'htmlOptions' => array(
    ),
));
    ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'due_date'); ?> <br/>
<?php
    $this->widget('application.extensions.timepicker.EJuiDateTimePicker', array(
    'model' => $model,
    'attribute' => 'due_date',
    'options' => array(
        'dateFormat' => 'yy-mm-dd',
        'minDate' => '2011-1-1',
        'showAnim' => 'fold',
    ),
    'htmlOptions' => array(
    ),
));
    ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'todo_list_id'); ?> <em>(optional)</em>
    <?php echo $form->dropDownList($model, 'todo_list_id', CHtml::listData(Yii::app()->user->model->todoLists, 'id', 'name'), array('prompt' => 'select todo list', 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'allday'); ?>
    <?php echo $form->checkBox($model, 'allday'); ?>
</p>
    
<div class="action">
    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'button button-gray')); ?>
</div>

<?php $this->endWidget(); ?>